package com.sy.controller;

import com.sy.dto.JsonResult;
import com.sy.entity.Cartoon;
import com.sy.service.CartoonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("gratis")
public class SortGratisController {

    @Autowired
    private CartoonService service;

    @RequestMapping(method = RequestMethod.GET)
    public JsonResult getSortByGratis(){
        JsonResult result = new JsonResult();
        List<Cartoon> sortByGratis = service.getSortByGratis();
        result.setData(sortByGratis);
        return result;
    }
}
